package com.py.firstproject.web;

import com.py.firstproject.pojo.Orders;
import com.py.firstproject.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/orders")

public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    @RequestMapping("/listAll")
    public List<Orders> liatAll(){
        return ordersService.list();
    }

}
